.Dd December 13, 2019
.Dt split32bit 1
.Os kk_ihex
.Sh NAME
.Nm split32bit
.Nd Splits a 32-bit ROM image into four 8-bit files.
.Sh SYNOPSIS
.Nm
.Op Fl i Ar input32bit.bin
.Op Fl 0 Ar out0.bin
.Op Fl 1 Ar out1.bin
.Op Fl 2 Ar out2.bin
.Op Fl 3 Ar out3.bin
.Sh DESCRIPTION
.Nm
reads a raw 32-bit binary file from standard input and writes four
separate output files, each containing separate 8-bit bytes that make
up each 32-bit input dword. The bytes are numbered from 0 to 3 by
address, i.e., the first byte of input is byte 0 (little endian).
.Sh OPTIONS
.Bl -tag -width -indent
.It Fl 0 Ar byte0file
Output to
.Ar byte0file
the first byte of every input word
.It Fl 1 Ar byte1file
Output to
.Ar byte1file
the second byte of every input word
.It Fl 2 Ar byte2file
Output to
.Ar byte2file
the third byte of every input word
.It Fl 3 Ar byte3file
Output to
.Ar byte3file
the fourth byte of every input word
.It Fl i Ar file
Read the binary input from
.Ar file
instead of standard input
.El
.Sh EXAMPLES
Read binary data from
.Ar be32.bin
and write the bytes to output files from
.Ar U1.bin
to
.Ar U4.bin
in big endian order:
.Pp
.Bd -ragged -offset indent
.Nm
.Fl i
.Ar be32.bin
.Fl 0
.Ar U4.bin
.Fl 1
.Ar U3.bin
.Fl 2
.Ar U2.bin
.Fl 3
.Ar U1.bin
.Ed
.Pp
.Sh SEE ALSO
.Xr merge32bit 1
.Sh AUTHOR
.An "Kimmo Kulovesi" Aq https://arkku.com
